%% calcSignalPeriod
%
% Takes in heartrate and outputs period of signal
%
%% Syntax
% [SignalPeriod] = calcSignalPeriod(HeartRate)
%
% [Tp] = calcSignalPeriod(HR)
%
%
%% Description
% Takes in heartrate and outputs period of signal
%
%
%% Arguments
%* heartrate                  - Double: A double precision number of
%                                        heartrate in BPM
%
%% Returns
%* SignalPeriod                - Double: A double precision value of
%                                         the signal period
%                                   
%
%% Function Side Effects
%* N/A
%
%% Exceptions
%* An error is thrown if input is not of type double
%
%% See Also
% N/A

function [SignalPeriod] = calcSignalPeriod(HeartRate)

if isa(HeartRate, 'double') ~=1
    type = class(HeartRate);
    error(sprintf(('Heart rate in BPM is of type %s please change to type double'), type))
    
end

SignalPeriod=1/(HeartRate/60);


end


